/*
 * @Author: 许旺玉
 * @Description: 封装get和post请求
 * @Date: 2020-06-28 13:02:52
 * @LastEditTime: 2020-07-06 14:09:07
 * @LastEditors: Please set LastEditors
 */
import httpRequest from "@/api/apiConfig.js"
export function ajaxGet(url, params) {  //get请求
    return httpRequest.get(url, {
        params,
        headers: {
            "content-type": "application/x-www-form-urlencoded"
        }
    })
}

export function ajaxPost(url, data) { //post请求
    return httpRequest.post(url, data, {
        headers: {
            "content-type": "application/x-www-form-urlencoded"
        }
    })
}

export function ajaxDel(url, params) {  //delete请求
    return httpRequest.delete(url, {
        params,
        headers: {
            "content-type": "application/x-www-form-urlencoded"
        }
    })
}


export function ajaxPut(url, data,) { //put请求
    return httpRequest.put(url, data, {
        headers: {
            "content-type": "application/x-www-form-urlencoded"
        }
    })

}

//文件上传封装
export function ajaxUpload(url, data) {
    return httpRequest.post(url, data, {
        headers: {
            "Content-Type":"multipart/form-data"
        },
    })
}